﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" targetNamespace="apprender">

    <xs:simpleType name="booleanType">
        <xs:restriction base="xs:NMTOKEN">
            <xs:enumeration value="true"/>
            <xs:enumeration value="false"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:complexType name="ClientResource" xmlns="apprender">

        <xs:choice minOccurs="1" maxOccurs="unbounded">
            <xs:element name="res">
                <xs:complexType>
                    <xs:attribute name="path" type="xs:string" use="required"/>
                </xs:complexType>
            </xs:element>
        </xs:choice>
        <xs:attribute name="enable-processing" type="booleanType"/>
    </xs:complexType>

    <xs:complexType name="ClientResourceGroup" xmlns="apprender">
        <xs:choice minOccurs="1" maxOccurs="unbounded">
            <xs:element name="group" type="ClientResource"/>
        </xs:choice>
    </xs:complexType>

    <xs:element name="apprender.web" xmlns="apprender">
        <xs:complexType>
            <xs:choice minOccurs="1" maxOccurs="unbounded">
                <xs:element name="reflection" maxOccurs="1" minOccurs="0">
                    <xs:complexType>
                        <xs:attribute name="enable-optimization" type="booleanType"/>
                    </xs:complexType>
                </xs:element>
                <xs:element name="data-service" maxOccurs="1" minOccurs="0">
                    <xs:complexType>
                        <xs:attribute name="enable-compression" type="booleanType"/>
                    </xs:complexType>
                </xs:element>
                 <xs:element name="compression-module" maxOccurs="1" minOccurs="0">
                    <xs:complexType>
                        <xs:attribute name="ext" type="xs:string"/>
                    </xs:complexType>
                </xs:element>
                <xs:element name="client-res" maxOccurs="1" minOccurs="0">
                    <xs:complexType>
                        <xs:choice minOccurs="1" maxOccurs="unbounded">
                            <xs:element name="js" type="ClientResourceGroup" maxOccurs="1"/>
                            <xs:element name="css" type="ClientResourceGroup" maxOccurs="1"/>
                        </xs:choice>
                    </xs:complexType>
                </xs:element>
            </xs:choice>
        </xs:complexType>
    </xs:element>
    
</xs:schema>
